<?php
class PatrimonioServico extends AppModel {

	var $name = 'PatrimonioServico';
	var $primaryKey = 'id_patrimonio_servico';
	var $validate = array(
//		'id_tipo_servico' => array('notempty'),
//		'id_tipo_patrimonio' => array('notempty'),
		'id_cidade' => array('notempty'),
		'nome' => array('notempty'),
		'bairro' => array('notempty'),
		'endereco' => array('notempty'),
		'localizacao' => array('notempty'),
		'cep' => array('notempty'),
		'telefone' => array('notempty')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'TipoPatrimonio' => array(
			'className' => 'TipoPatrimonio',
			'foreignKey' => 'id_tipo_patrimonio',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'TipoServico' => array(
			'className' => 'TipoServico',
			'foreignKey' => 'id_tipo_servico',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Cidade' => array(
			'className' => 'Cidade',
			'foreignKey' => 'id_cidade',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	
	var $hasOne = array(
		'CulturalHistorico' => array(
			'className' => 'CulturalHistorico',
			'foreignKey' => 'id_patrimonio_servico',
			'dependent' => true,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Hidrografia' => array(
			'className' => 'Hidrografia',
			'foreignKey' => 'id_patrimonio_servico',
			'dependent' => true,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Vegetacao' => array(
			'className' => 'Vegetacao',
			'foreignKey' => 'id_patrimonio_servico',
			'dependent' => true,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Relevo' => array(
			'className' => 'Relevo',
			'foreignKey' => 'id_patrimonio_servico',
			'dependent' => true,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Tecnologia' => array(
			'className' => 'Tecnologia',
			'foreignKey' => 'id_patrimonio_servico',
			'dependent' => true,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
	);
	
	var $hasMany = array(
		'TipoOpcionalPatrimonioServico' => array(
			'className' => 'TipoOpcionalPatrimonioServico',
			'foreignKey' => 'id_patrimonio_servico',
			'dependent' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

	var $hasAndBelongsToMany = array(
		'Avaliacao' => array(
			'className' => 'Avaliacao',
			'joinTable' => 'avaliacao_patrimonio_servico',
			'foreignKey' => 'id_patrimonio_servico',
			'associationForeignKey' => 'id_avaliacao',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'Eventos' => array(
			'className' => 'Eventos',
			'joinTable' => 'eventos_patrimonio_servico',
			'foreignKey' => 'id_patrimonio_servico',
			'associationForeignKey' => 'id_eventos',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'Franquias' => array(
			'className' => 'Franquias',
			'joinTable' => 'franquia_patrimonio_servico',
			'foreignKey' => 'id_patrimonio_servico',
			'associationForeignKey' => 'id_franquia',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'LinhaRegular' => array(
			'className' => 'LinhaRegular',
			'joinTable' => 'linha_regular_patrimonio_servico',
			'foreignKey' => 'id_patrimonio_servico',
			'associationForeignKey' => 'id_linha_regular',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'ManifestacaoPopular' => array(
			'className' => 'ManifestacaoPopular',
			'joinTable' => 'manifestacao_popular_patrimonio_servico',
			'foreignKey' => 'id_patrimonio_servico',
			'associationForeignKey' => 'id_manifestacao_popular',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

}
?>